In a computer’s system of arithmetic each data bus wire represents a binary digit (bit) with the values of 1, 2, 4, 8, etc.
Older computers use 8-bit code but most modern machines use a 16, 24 or 32-bit bus. The 68000 processor in the original Mac handled 32-bit data in 16-bit chunks but many later machines used a 32-bit 68020-40 processor. All PowerMacs use 32-bit addressing.
A byte consists of 8 bits of data (really an 8-bit code) that can represent anything from one ASCII character to half a sample of 16-bit digital audio.
Each byte may be divided into two 4-bit nibbles.
The size of any memory or disk drive is measured in bytes, kilobytes or megabytes. One kilobyte (KB or K) equals 1,024 bytes, one megabyte (MB or M) equals 1,048,576 bytes and one gigabyte (GB or G) is 1,073,741,824 bytes (equivalent to 179 million words!).
Apple usually measure memory in small K’s which are only 1000 bytes each. Other manufacturers use small M’s to represent 1,000,000 bytes or small G‘s to for only 1,000,000,000 bytes. Very confusing!
Hexadecimal Notation
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Hexadecimal or Hex is a shorthand notation used by programmers to represent binary numbers. Values from zero to 15 are shown by the numbers 0 to 9 followed by the letters A to F. Hence decimal 14 is hex E.
For larger values each digit in hex represents half a byte or a nibble. The decimal values of 64, 128 and 255 are represented in hex as 40, 80 and FF respectively.
Character Codes
qqqqqqqqqqqq
Each character used in a computer must be assigned a unique numerical code. With 7-bit addressing its possible to use codes from 0 to 127 — that’s 128 characters. 8-bit addressing can use all of these plus codes 128 to 255 — making a total of 256 characters.
Some 7-bit systems use control codes (see below) to tell a device to use 8-bit values instead of the normal 7-bit values. Once a device receives such a shift instruction it simply adds 128 to any 7-bit value it receives!
The Macintosh Keyboard
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
The codes generated by the keys on a Mac usually change if pressed in combination with the Shift, Option or † keys. Not all keyboards generate every code — the Mac keyboard doesn’t produce the numbers 252 to 255 and values above 218 are rarely used by other computers. Codes that don’t represent a character may appear on the screen as a box (#).
Many function keys (F4, F5…) are undefined, although some applications do use them. Utilities such as QuicKeys can define the purpose of any key combination — a universal definition will override the combination’s original purpose in every application.
The exact character produced by a Mac keyboard varies according to the font in use. To check the characters in your font you can use KeyCaps, which usually appears under the  menu. If you’re uncertain as to what key to press then try PopChar, a control panel that displays all available characters via a pop-up menu in the menu bar.
American Standard for Information Interchange
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
The ASCII standard, similar to ISO 646, defines the 7-bit computer numbers (in the range of 0 to 127) that represent the characters used for letters, numbers and punctuation. On some computers this is known as the standard character set.
It also defines the numbers for control codes, such as tab, carriage return (CR), line feed (LF) and form feed (FF). Many computers ignore other control codes, with the possible exception of Control-G. A pure ASCII file usually contains standard characters and the commonly accepted control codes.
The table below shows the ASCII codes and characters as implemented on a Mac:-
ASCII Character ASCII Character
Code Key Sequence Code Key Sequence
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
0* NUL Not available 16* DLE Ctrl-P or F1-F15
1* SOH Ctrl-A or Home 17* DC1 Ctrl-Q
2* STX Ctrl-B 18* DC2 Ctrl-R
3* ETX Ctrl-C or Enter 19* DC3 Ctrl-S
4* EOT Ctrl-D or End 20* DC4 Ctrl-T
5* ENQ Ctrl-E or Help 21* NAK Ctrl-U
6* ACK Ctrl-F 22* SYN Ctrl-V
7* BEL Ctrl-G 23* ETB Ctrl-W
8 BS Ctrl-H or Delete 24* CAN Ctrl-X
9 HT Ctrl-I or Tab 25* EM Ctrl-Y
10* LF Ctrl-J 26* SUB Ctrl-Z
11* VT Ctrl-K or Page Up 27 ESC Esc or Clear
12* FF Ctrl-L or Page Down 28 FS < Arrow
13 CR Ctrl-M or Return 29 GS > Arrow
14* SO Ctrl-N 30 RS ÀÜ Arrow
15* SI Ctrl-O 31 US v Arrow
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
32 SP Space 48 0 0
33 ! Shift-1 49 1 1
34 " Shift-' 50 2 2
35 # Option-3• 51 3 3
36 $ Shift-4 52 4 4
37 % Shift-5 53 5 5
38 & Shift-7 54 6 6
39 ' ' 55 7 7
40 ( Shift-9 56 8 8
41 ) Shift-0 57 9 9
42 * Shift-8 58 : Shift-;
43 + Shift-= 59 ; ;
44 , , 60 < Shift-,
45 - - 61 = =
46 . . 62 > Shift-.
47 / / 63 ? Shift-/
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
64 @ Shift-2 80 P Shift-P
65 A Shift-A 81 Q Shift-Q
66 B Shift-B 82 R Shift-R
67 C Shift-C 83 S Shift-S
68 D Shift-D 84 T Shift-T
69 E Shift-E 85 U Shift-U
70 F Shift-F 86 V Shift-V
71 G Shift-G 87 W Shift-W
72 H Shift-H 88 X Shift-X
73 I Shift-I 89 Y Shift-Y
74 J Shift-J 90 Z Shift-Z
75 K Shift-K 91 [ [
76 L Shift-L 92 \ \
77 M Shift-M 93 ] ]
78 N Shift-N 94 ^ Shift-6
79 O Shift-O 95 _ Shift-_
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
96 ` ` 112 p P
97 a A 113 q Q
98 b B 114 r R
99 c C 115 s S
100 d D 116 t T
101 e E 117 u U
102 f F 118 v V
103 g G 119 w W
104 h H 120 x X
105 i I 121 y Y
106 j J 122 z Z
107 k K 123 { Shift-[
108 l L 124 | Shift-\
109 m M 125 } Shift-]
110 n N 126 ~ Shift-`
111 o O 127* DEL Forward Delete
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
• Shift-3 with a US system
* Not all Macintosh keyboards can produce these codes
ISO Latin-1 Encoding
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Some computers and printers use the numbers 128 to 255 to represent a different print style, such as italic. The Mac uses them for a further range of symbols, an alternative character set. Different ISO versions are used for Arabic, Cyrillic or Greek text. The following table shows how the Mac implements the ISO Latin-1 standard:-
* Not all Macintosh keyboards can produce these codes
# These characters can also be produced with a ‘dead key’ sequence.
NBSP = Non-breaking Space
Unicode
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
The 256 characters represented by 8-bit ASCII codes aren’t adequate for the huge number of characters used in pictographic languages such as Chinese or Japanese. Unicode, also known as ISO 10646M defines 65,536 characters using 16-bit codes as follows:-
From To Meaning
0 8,191 Alphabetic Characters (0-256 as above)
8,192 12,287 Alphabetic punctuation, symbols and dingbats
You may occasionally encounter an Expanded Binary Coded Decimal Interchange Code (EBCDIC) text file, used on IBM mainframe and mini-computers. A special application is necessary to convert these into ASCII or Latin-1 codes. Not all codes are entirely standardised. The following tables only shows those codes universally employed in the IBM System/360 EBCDIC character set. They begin with the following control codes:-
EBCDIC Name Control Code
Code Function
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
0 NUL* Null
1 SOH* Start of heading
2 STX* Start of text
3 ETX* End of text
4 PF Punch off
5 HT Horizontal tabulation
6 LC Lower case
7 DEL Delete
8
9
10 SMM Start of manual message
11 VT* Vertical tabulation
12 FF* Form feed
13 CR* Carriage return
14 SO* Shift out
15 SI* Shift in
* Indicates codes with similar function in ASCII standard
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
16 DLE Data link escape
17 DC1* Device control character 1
18 DC2* Device control character 2
19 DC3* Device control character 3
20 RES Restore
21 NL New line
22 BS Back space
23 IL Idle
24 CAN* Cancel
25 EM* End of medium
26 CC Cursor control
27 CU1 Customer use 1
28 IFS* Interchange File separator
29 IGS* Interchange Group separator
30 IRS* Interchange Record separator
31 IUS* Interchange Unit separator
* Indicates codes with similar function in ASCII standard
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
32 DS Digit select
33 SOS Start of significance
34 FS Field separator
35
36 BYP Bypass
37 LF Line feed
38 ETB End of transmission block
39 ESC Escape
40
41
42 SM Set mode
43 CU2 Customer use 2
44
45 ENQ Enquire
46 ACK Acknowledge
47 BEL Bell
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
48
49
50 SYN Synchronous idle
51
52 PN Punch in
53 RS Reader stop
54 UC Upper case
55 EOT End of transmission
56
57
58
59 CU3 Customer use 3
60 DC4 Device control character 4
61 NAK Not acknowledge
62
63 SUB Substitute
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
64 SP Space
The characters are represented in the following groups:-
Code Char Code Char Code Char Code Char
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
74 ¢ 91 $ 106 : 122 :
75 , 92 . 107 , 123 #
76 < 93 ) 108 % 124 @
77 ( 94 ; 109 _ 125 '
78 + 95 ¬ 110 > 126 =
79 | 96 / 111 ? 127 "
80 &
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
129 a 145 j 162 s
130 b 146 k 163 t
131 c 147 l 164 u
132 d 148 m 165 v
133 e 149 n 166 w
134 f 150 o 167 x
135 g 151 p 168 y
136 h 152 q 169 z
137 i 153 r
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
193 A 209 J 226 S 240 0
194 B 210 K 227 T 241 1
195 C 211 L 228 U 242 2
196 D 212 M 229 V 243 3
197 E 213 N 230 W 244 4
198 F 214 O 231 X 245 5
199 G 215 P 232 Y 246 6
200 H 216 Q 233 Z 247 7
201 I 217 R 248 8
249 9
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Coding Variations
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
You may need to convert data containing the full 8-bit ASCII/Latin-1 Macintosh character set into 7-bit data for transmission over a modem. The table below shows the best equivalent characters to use — some applications can do this for you automatically!
It may be convenient to convert all carriage returns into two carriage returns. Soft return characters (Shift-returns) may be converted to spaces.
End-of-Lines
The characters defining an end-of -line (EOL) in text vary between files created on different computers, depending how carriage returns (CR) and line feeds (LF) are interpreted. The most common standards are:-
System End of Line
Mac CR
MS-DOS CR followed by LF
UNIX LF
VAX CR followed by LF
Control Codes
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Characters that appear in the ASCII and EBCDIC tables as 2- or 3-letter abbreviations are control codes. Computer terminals generate such codes using a combination of the Control key and a letter. Where a Mac is used to emulate a terminal another combination of keys can be used to the same effect — essential if your keyboard lacks a Control key. In most applications the Ç, Control or Option key is used in combination with the CNTL letters shown in the table below — or another letter chosen by software!
The full set of control codes used in the ASCII standard are:-
Dec Hex CNTL Name Function
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
0 00 ^@ NUL Null
1 01 ^A SOH Start of heading
2 02 ^B STX Start of text
3 03 ^C ETX End of text
4 04 ^D EOT End of transmission
5 05 ^E ENQ Enquiry
6 06 ^F ACK Acknowledge
7 07 ^G BEL Bell
8 08 ^H BS Backspace
9 09 ^I HT Horizontal tabulation
10 0A ^J LF Line feed
11 0B ^K VT Vertical tabulation
12 0C ^L FF Form feed
13 0D ^M CR Non-marking return
14 0E ^N SO Shift out
15 0F ^O SI Shift in
16 10 ^P DLE Data link escape
17 11 ^Q DC1 Device control 1
18 12 ^R DC2 Device control 2
19 13 ^S DC3 Device control 3
20 14 ^T DC4 Device control 4
21 15 ^U NAK Negative acknowledge
22 16 ^V SYN Synchronous idle
23 17 ^W ETB End of transmission block
24 18 ^X CAN Cancel
25 19 ^Y EM End of medium
26 1A ^Z SUB Substitute
27 1B ^[ ESC Escape
28 1C ^\ FS File separator
29 1D ^] GS Group separator
30 1E ^~ RS Record separator
31 1F ^_ US Unit separator
127 7F ^! DEL Delete
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
With some software you actually have to type the circumflex accent (^) prior to the CNTL letter, so that backspace (BS) is entered as ^H and carriage return (CR) as ^M. To send the ^ character itself you may type ^^, even though this really should represent RS in a standard character sequence. RS may use ^> and US may use ^? as alternatives. In some cases DEL may also use a unique sequence.
Some software and computer systems use the codes as follows:-
Code Effect
^C Aborts the current operation
^H Backspace, deleting the last character typed
^I Attempts to complete file and folder names
^M Terminates a command entry and starts its execution
^Z End of file (EOF) when storing text into a file
Two control codes, ^S and ^Q, are often used by terminals to pause and resume long listings on a monitor screen. You can press ^S when you spot something that you want to read — then press ^Q to resume the listing or ^C to abort it.
Escape Sequences
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
ASCII data sent to printers may include Escape sequences that send instructions to the destination. The ESC control code is followed by a string of data bytes. The following examples are used by Epson printers:-